<style>
@media print{
	#hide{
		display:none;
	}
}
#hide{
	width: 150px;
	height:30px; 
}
</style>
<center>
<input type="button" value="Close Window" id="hide" onClick="window.close()"> <input type="button" value="Print Receipt" id="hide" onClick="window.print() ">
</center>
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/includes/config.inc.php');
include_once("config.php");
getConfig();
checkActiveLogin();
getUserInfo();
$hardware = false;
$software = false;
$sql = "SELECT * FROM `tbLoanReceipts` WHERE `sReceiptId` = :id";
$q = db::Query($sql, array(':id'=>$_GET['id']));
$receipt_info = $q->fetch();
if($receipt_info['sType'] == 'Hardware'){
	$hardware = true;
}else{
	$software = true;
}

$duedate = $receipt_info['sDue'];
if($hardware){
?>
<title>Edison State College Loan Receipt</title>
<body>
<div style="position:absolute; top:10; right:20; text-align:center; font-weight:bold; font-size:18px">
Receipt ID:<br/>
<?php echo $_GET['id'] ?>
</div>
<b>
    <center>
        Edison State College<br />
        College Administrative Procedures<br />
        Division of Technology Services<br />
        <br />
        Technology Services Division Equipment Loan Program
    </center>
    <hr />
    <br>
    <br>
    <table>
        <tr>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo $receipt_info['sFname']." ".$receipt_info['sLname'] ?></td>
            <td width="30px">&nbsp;</td>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo $receipt_info['sDepartment'] ?></td>
        </tr>
        <tr>
            <td><b>&nbsp;&nbsp;&nbsp;Requestor's Name</b></td>
            <td width="30px">&nbsp;</td>
            <td><b>&nbsp;&nbsp;&nbsp;Department/Divison - Campus</b></td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo $receipt_info['sPhone'] ?></td>
            <td width="30px">&nbsp;</td>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo $receipt_info['sDate'] ?></td>
        </tr>
        <tr>
            <td><b>&nbsp;&nbsp;&nbsp;Office Phone Number</b></td>
            <td width="30px">&nbsp;</td>
            <td><b>&nbsp;&nbsp;&nbsp;Equipment Check-Out Date</b></td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px">&nbsp;</td>
            <td width="30px">&nbsp;</td>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo date("F d, Y", $receipt_info['sDue']) ?></td>
        </tr>
        <tr>
            <td><b>&nbsp;&nbsp;&nbsp;Director or VP Approval</b></td>
            <td width="30px">&nbsp;</td>
            <td><b>&nbsp;&nbsp;&nbsp;Equipment Return Date</b></td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
            <td style="border-bottom:solid; border-bottom-width:1px" colspan="3"><b>Academic/Business Purpose:</b> <?php echo $receipt_info['sPurpose'] ?></td>
        </tr>
    </table>
    <br />
    <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td><b>&nbsp;&nbsp;&nbsp;Equipment Issued</b></td>
            <td width="100px" style="border:solid; border-width:1px; padding-top:5px; padding-bottom:5px; padding-left:5px;">&#8730; = Issued</td>
            <td width="100px" style="border:solid; border-width:1px; padding-top:5px; padding-bottom:5px; padding-left:5px;">&#8730; = Returned</td>
        </tr>
            <?php
			$sql = "SELECT * FROM `tbLoanLink` WHERE `sReceiptId` = :id";
			$q = db::Query($sql, array(':id'=>$_GET['id']));
			while($value = $q->fetch()){
				$sql = "SELECT * FROM `tbHardware` WHERE `iItemID` = :id ORDER BY `sMain` DESC";
				$q = db::Query($sql, array(':id'=>$value['sItemIdentifier']));
				$row2 = $q->fetch();
				if($row2['iItemID'] != $value['sItemIdentifier']){
					//$software = true;
				}else{
					$q = db::Query($sql, array(':id'=>$value['sItemIdentifier']));
					while($row2 = $q->fetch()){
                    ?>
        <tr>
            <td style="border:solid; border-width:1px; padding-top:5px; padding-bottom:5px; padding-left:5px;"><?php echo $row2['sDescription'] ?></td>
            <td width="100px" align="center" style="border:solid; border-width:1px;">&#8730;</td>
            <td width="100px" style="border:solid; border-width:1px;">&nbsp;</td>
        </tr>
                    <?php };
            	}; 
			} ?>
    </table><br />
    I have read the Technology Services Division Equipment Loan Program Procedure.  By signing below, I certify that the equipment indicated above was checked-out/checked-in as indicated and hereby agree to abide be the terms stated in the Technology Services Division Equipment Loan Program Procedure and will provide proper care according to the guidelines.  I understand that the department of the signed employee is assuming financial reponibility for the equipment.
    <table>
        <tr>
            <td valign="top"><br />
                <b>CHECK-OUT:</b><br><br>
                ___________________________<br>
                Date Checked Out<br><br>
                ___________________________<br>
                <?php echo $receipt_info['sFname']." ".$receipt_info['sLname'] ?><br><br>
            ___________________________<br>
            <?php
			$sql = "SELECT * FROM SPRIDEN, GOBTPAC WHERE SPRIDEN_PIDM = GOBTPAC_PIDM AND GOBTPAC_EXTERNAL_USER = :uname AND SPRIDEN_CHANGE_IND is null";
$q = Oracle::Query($sql, array(':uname'=>$receipt_info['sUname']));
$row = $q->fetch();
			?>
            <?php echo $row['SPRIDEN_FIRST_NAME']." ".$row['SPRIDEN_LAST_NAME'] ?> - Tech Center SA
        </td>
        <td width="90">
        </td>
        <td valign="top"><br />
            <b>CHECK-IN:</b><br><br>
            ___________________________<br>
            Date Checked In<br><br>
            ___________________________<br>
            Incoming Tech Center SA
        </td>
        </tr>
    </table>
<?php } ?>
<?php
if($software){
?>
<div style="page-break-before:always; position:relative; width:100%">
<div style="position:absolute; top:10; right:20; text-align:center; font-weight:bold; font-size:18px">
Receipt ID:<br/>
<?php echo $_GET['id'] ?>
</div>
<b>
    <center>
        Edison State College<br />
        College Administrative Procedures<br />
        Division of Technology Services<br />
        <br />
        Technology Software Loan Program
    </center>
    <hr />
    <br>
    <br>
    Requestor's Name: </b> <?php echo $receipt_info['sFname']." ".$receipt_info['sLname'] ?><br><br>
<b>Phone or Extension Number: </b><?php echo $receipt_info['sPhone'] ?><br><br>
<b>E-Mail Address: </b><?php echo $receipt_info['sEmail'] ?><br><br>
<b>Department/Division: </b><?php echo $receipt_info['sDepartment'] ?><br><br>
<?php
$sql = "SELECT * FROM `tbLoanLink` WHERE `sReceiptId` = :id";
$q = db::Query($sql, array(':id'=>$_GET['id']));
$row = $q->fetch();
?>
<b>Software Title Checked-Out: </b><?php echo $row['sItem'] ?><br /><br />
<b>Software Disc ID: </b><?php echo $row['sItemIdentifier'] ?><br><br><br>
<b>Software Guidlines:<br></b>
&nbsp;&nbsp;&nbsp;1. Do not copy<br>
&nbsp;&nbsp;&nbsp;2. Only install on 1 PC and 1 Laptop<br>
&nbsp;&nbsp;&nbsp;3. Return within 72 hours<br><br><br>
By signing below, I certify that the software indicated above was checked-out/checked-in as indicated and hereby agree to abide by the terms stated in the Technology Services Division Software Loan Program Procedue and will provide proper care according to the guidlines.  I understand that the department of the signed employee is assuming financial responsibility for the software.<br><br><br>
<table>
    <tr>
        <td valign="top">
            <b>CHECK-OUT:</b><br><br>
            ___________________________<br>
            Date Checked Out<br><br>
            ___________________________<br>
            <?php echo $receipt_info['sFname']." ".$receipt_info['sLname'] ?><br><br>
            ___________________________<br>
            <?php
			$sql = "SELECT * FROM SPRIDEN, GOBTPAC WHERE SPRIDEN_PIDM = GOBTPAC_PIDM AND GOBTPAC_EXTERNAL_USER = :uname AND SPRIDEN_CHANGE_IND is null";
$q = Oracle::Query($sql, array(':uname'=>$receipt_info['sUname']));
$row = $q->fetch();
			?>
            <?php echo $row['SPRIDEN_FIRST_NAME']." ".$row['SPRIDEN_LAST_NAME'] ?> - Tech Center SA
        </td>
        <td width="90">
        </td>
        <td valign="top">
            <b>CHECK-IN:</b><br><br>
            ___________________________<br>
            Date Checked In<br><br>
            ___________________________<br>
            Incoming Tech Center SA
        </td>
    </tr>
</table>
</div>
<?php } ?>
</body>